import { createRouter, createWebHashHistory } from 'vue-router'

import Layout from '@/components/layout/Layout.vue'





const router = createRouter({
  history: createWebHashHistory(),
  routes: [
    {
      path: '/',
      component: Layout,
       redirect:'/dashboard',
      meta: { requiresAuth: false  },
      children: [
         {
        path: '/dashboard',
        component: () =>import('../views/dashboard/Dashboard.vue'),
        meta: { requiresAuth: false ,
          "title": "系统日志",
          "hidden": false,
          "keepAlive": false,
          "alwaysShow": false,
          "params": null,
          "affix": false
         },

        },
        {
          path: '/questions',
           children:[
            {
              path: 'edit',
              component: () =>import('../views/question/index.vue'),
              meta: {
                requiresAuth: false ,
                "title": "系统日sda志",
              "hidden": false,
              "keepAlive": false,
              "alwaysShow": false,
              "params": null
               },
            },
            {
              path: 'question-banks',
              component: () =>import('../views/question/QuestionBanks.vue'),
              meta: { requiresAuth: false  }
            },
             {
          path: 'subject',
          component: () =>import('../views/question/subject.vue'),
          meta: { requiresAuth: true,
            "title": "系统日sdsadsa志",
          "hidden": false,
          "keepAlive": false,
          "alwaysShow": false,
          "params": null
           }
        },
           ]
        },

        {
          path: '/exam-manage',
          component: () =>import('../views/examManage/index.vue'),
          meta: { requiresAuth: false ,
            "title": "系统日sdsadsa志",
          "hidden": false,
          "keepAlive": false,
          "alwaysShow": false,
          "params": null
            }
        },

     {
          path: '/exam-monitor',
          component: () =>import('../views/examMonitor/index.vue'),
          meta: { requiresAuth: false
            ,
            "title": "系统日sdsadsa志",
          "hidden": false,
          "keepAlive": false,
          "alwaysShow": false,
          "params": null
           }
        },

        {
          path: '/paper-generator',
          component: () => import('../views/paperManage/PaperLayout.vue'),
          children: [
            {
              path: '',
              name: 'PaperGenerator',
              component: () => import('../views/paperManage/PaperEdit.vue')
            },
            {
              path: 'edit',
              name: 'PaperEdit',
              props: route => ({ query: route.query }) ,// 通过props传递参数
              component: () => import('../views/paperManage/paper.vue')
            }
          ]
        },
        {
          path: '/users',
          component: () =>import('../views/users/Users.vue'),
          meta: {
            requiresAuth: false ,
            "title": "系统日sdsadsa志",
          "hidden": false,
          "keepAlive": false,
          "alwaysShow": false,
          "params": null
            }
        },

        {
          path: '/paperSelect',
          component: () =>import('../views/examManage/paperSelect.vue'),
          meta: {
            requiresAuth: true ,
          "title": "试卷选择",
          "hidden": true,
          "keepAlive": false,
          "alwaysShow": false,
          "params": null
            }
        },
        {
          path: '/paperConfig/:id', // 动态参数 :id
          component: () => import('../views/examManage/ExamConfig.vue'),
          meta: {
            requiresAuth: true,
            title: "考试配置",
            hidden: true,
            keepAlive: false,
            alwaysShow: false,
            params: null
          }
        },
        {
          path: '/chat',
          component: () =>import('../views/chat/chat.vue'),
          meta: { requiresAuth: false ,
            "title": "系统日sdsadsa志",
          "hidden": false,
          "keepAlive": false,
          "alwaysShow": false,
          "params": null
            }
        },
              {
          path: '/examGrade',
          component: () =>import('../views/grading/ExamGrading.vue'),
          meta: { requiresAuth: true ,
            "title": "系统日sdsadsa志",
          "hidden": false,
          "keepAlive": false,
          "alwaysShow": false,
          "params": null
            }
        },
        {
          path: '/results',
          component: () =>import('../views/result/Results.vue'),
          meta: { requiresAuth: false  }
        },
    ]
    },

    {
      path: '/login',
      component: () =>import('../views/login/Login.vue'),
      meta: { requiresAuth: false  }
    },
    {
      path: '/:catchAll(.*)',
      name: 'Page404',
      component: () => import('../views/page404/page404.vue'),
  },


  ],
})






export default router
